3.5 \(\int \csc (x) (a \cos (x)+b \sin (x)) \, dx\)

Optimal. Leaf size=9 \[ a \log (\sin (x))+b x \]

[Out]

b*x + a*Log[Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0190863, antiderivative size = 9, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3085, 3475} \[ a \log (\sin (x))+b x \]

Antiderivative was successfully verified.

[In]

Int[Csc[x]*(a*Cos[x] + b*Sin[x]),x]

[Out]

b*x + a*Log[Sin[x]]

Rule 3085

Int[sin[(c_.) + (d_.)*(x_)]^(m_)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Symb
ol] :> Int[(b + a*Cot[c + d*x])^n, x] /; FreeQ[{a, b, c, d}, x] && EqQ[m + n, 0] && IntegerQ[n] && NeQ[a^2 + b
^2, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \csc (x) (a \cos (x)+b \sin (x)) \, dx &=\int (b+a \cot (x)) \, dx\\ &=b x+a \int \cot (x) \, dx\\ &=b x+a \log (\sin (x))\\ \end{align*}

Mathematica [A]  time = 0.0051956, size = 9, normalized size = 1. \[ a \log (\sin (x))+b x \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]*(a*Cos[x] + b*Sin[x]),x]

[Out]

b*x + a*Log[Sin[x]]

________________________________________________________________________________________

Maple [A]  time = 0.037, size = 10, normalized size = 1.1 \begin{align*} bx+a\ln \left ( \sin \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)*(a*cos(x)+b*sin(x)),x)

[Out]

b*x+a*ln(sin(x))

________________________________________________________________________________________

Maxima [A]  time = 1.16693, size = 12, normalized size = 1.33 \begin{align*} b x + a \log \left (\sin \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="maxima")

[Out]

b*x + a*log(sin(x))

________________________________________________________________________________________

Fricas [A]  time = 0.489148, size = 34, normalized size = 3.78 \begin{align*} b x + a \log \left (\frac{1}{2} \, \sin \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="fricas")

[Out]

b*x + a*log(1/2*sin(x))

________________________________________________________________________________________

Sympy [A]  time = 1.55686, size = 8, normalized size = 0.89 \begin{align*} a \log{\left (\sin{\left (x \right )} \right )} + b x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x)

[Out]

a*log(sin(x)) + b*x

________________________________________________________________________________________

Giac [B]  time = 1.0948, size = 32, normalized size = 3.56 \begin{align*} b x - a \log \left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right ) + a \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="giac")

[Out]

b*x - a*log(tan(1/2*x)^2 + 1) + a*log(abs(tan(1/2*x)))